import Vue from 'vue'
import Router from 'vue-router'

import Home from '../components/Home'
import Course from "../components/Course.vue";
import Detail from "../components/Detail";
import Cart from "../components/Cart";
import Login from "../components/Login";
import Register from "../components/Register";
import PerfectInformation from "../components/PerfectInformation";
import RetrievePassword from "../components/RetrievePassword";

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',  // 路径起别名
      component: Home,
    },
    {
      path: '/course/',
      name: 'Course',  // 路径起别名
      component: Course,
    },
    {
      path: '/course/detail/:id/',
      name: 'Detail',  // 路径起别名
      component: Detail,
    },
    {
      path: '/cart/',
      name: 'Cart',  // 路径起别名
      component: Cart,
    },
    {
      path: '/login/',
      name: 'Login',
      component: Login
    },
    {
      path: '/register/',
      name: 'Register',
      component: Register,
    },
    {
      path: '/perfect-information/',
      name: 'PerfectInformation',
      component: PerfectInformation,
    },
    {
      path: '/retrieve-password/',
      name: 'RetrievePassword',
      component: RetrievePassword,
    },
  ]
})
